import http from "@/api/index";

// 用户列表
export const getList = data => {
  return http.get(`/manager/list`, data);
};

// 添加用户
export const addManager = (data: ReqLoginForm) => {
  return http.post<ManagerData>(`/manager/add`, data);
};

// 用户详情
export const getDetail = (id: number) => {
  return http.get(`/manager/detail?id=${id}`);
};

// 修改用户信息
export const editManager = data => {
  return http.post(`/manager/update`, data);
};

export interface ReqLoginForm {
  account: string;
  password: string;
}

export interface ManagerData {
  id?: number;
  account: string;
  password: string;
  email?: string;
  phone?: number;
  avatar?: string;
  status: number;
  is_super?: string;
  role_ids: number[];
}
